/*
 * ThreadHybridSystemController.cpp
 *
 *  Created on: Jan 27, 2013
 *      Author: Drew Prevost
 */

#include "ThreadHybridSystemController.h"

ThreadHybridSystemController::ThreadHybridSystemController(
                                                            uint8_t nKcVmPin,
                                                            int nKcVmPinMin,
                                                            int nKcVmPinMax,
                                                            int nKcVmVoltsMin,
                                                            int nKcVmVoltsMax,
                                                            unsigned long nKcVmReadFreqMicros,
                                                            uint8_t nKcEngServoPin,
                                                            unsigned long nKcEngServoMaxSpeedInMicrosPerDegree,
                                                            unsigned int nKcEngServoInitialPosition,
                                                            uint8_t nKcEngPinGlowPlug,
                                                            uint8_t nKcEngPinGenConnect,
                                                            uint8_t nKcEngPinStarterMotor,
                                                            uint8_t nKcEngPinGenDisonnect,
                                                            uint8_t nKcEngPinGenMonitor,
                                                            int nDcTachPin,
                                                            int nDcTachIrqNum,
                                                            int nDcTachIsrPin,
                                                            int nDcTachIsrMode,
                                                            int nDcMotorPin,
                                                            int nDcServoPin,
                                                            unsigned long nDcServoMaxSpeedInMicrosPerDegree,
                                                            unsigned int nDcServoInitialPosition,
                                                            unsigned int nDcServoInitialRateInDegPerSec )
    : threadKeepCharged( nKcVmPin, nKcVmPinMin, nKcVmPinMax, nKcVmVoltsMin, nKcVmVoltsMax, nKcVmReadFreqMicros, nKcEngServoPin, nKcEngServoMaxSpeedInMicrosPerDegree, nKcEngServoInitialPosition, nKcEngPinGlowPlug, nKcEngPinGenConnect, nKcEngPinStarterMotor, nKcEngPinGenDisonnect, nKcEngPinGenMonitor ),
      threadDriveController( nDcTachPin, nDcTachIrqNum, nDcTachIsrPin, nDcTachIsrMode, nDcMotorPin, nDcServoPin, nDcServoMaxSpeedInMicrosPerDegree, nDcServoInitialPosition, nDcServoInitialRateInDegPerSec )
{

}

ThreadHybridSystemController::~ThreadHybridSystemController()
{
}

bool ThreadHybridSystemController::run()
{
  threadKeepCharged.run();
  threadDriveController.run();

//  PT_BEGIN();
//
//  PT_END();
  return true;
}
